package com.ruoyi.cost.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cost.mapper.CostCustomerInfoMapper;
import com.ruoyi.cost.domain.CostCustomerInfo;
import com.ruoyi.cost.service.ICostCustomerInfoService;

/**
 * 客户账户Service业务层处理
 * 
 * @author zomcx
 * @date 2025-06-12
 */
@Service
public class CostCustomerInfoServiceImpl implements ICostCustomerInfoService 
{
    @Autowired
    private CostCustomerInfoMapper costCustomerInfoMapper;

    /**
     * 查询客户账户
     * 
     * @param costCustomerId 客户账户主键
     * @return 客户账户
     */
    @Override
    public CostCustomerInfo selectCostCustomerInfoByCostCustomerId(Long costCustomerId)
    {
        return costCustomerInfoMapper.selectCostCustomerInfoByCostCustomerId(costCustomerId);
    }

    /**
     * 查询客户账户列表
     * 
     * @param costCustomerInfo 客户账户
     * @return 客户账户
     */
    @Override
    public List<CostCustomerInfo> selectCostCustomerInfoList(CostCustomerInfo costCustomerInfo)
    {
        return costCustomerInfoMapper.selectCostCustomerInfoList(costCustomerInfo);
    }

    /**
     * 新增客户账户
     * 
     * @param costCustomerInfo 客户账户
     * @return 结果
     */
    @Override
    public int insertCostCustomerInfo(CostCustomerInfo costCustomerInfo)
    {
        costCustomerInfo.setCreateTime(DateUtils.getNowDate());
        return costCustomerInfoMapper.insertCostCustomerInfo(costCustomerInfo);
    }

    /**
     * 修改客户账户
     * 
     * @param costCustomerInfo 客户账户
     * @return 结果
     */
    @Override
    public int updateCostCustomerInfo(CostCustomerInfo costCustomerInfo)
    {
        costCustomerInfo.setUpdateTime(DateUtils.getNowDate());
        return costCustomerInfoMapper.updateCostCustomerInfo(costCustomerInfo);
    }

    /**
     * 批量删除客户账户
     * 
     * @param costCustomerIds 需要删除的客户账户主键
     * @return 结果
     */
    @Override
    public int deleteCostCustomerInfoByCostCustomerIds(Long[] costCustomerIds)
    {
        return costCustomerInfoMapper.deleteCostCustomerInfoByCostCustomerIds(costCustomerIds);
    }

    /**
     * 删除客户账户信息
     * 
     * @param costCustomerId 客户账户主键
     * @return 结果
     */
    @Override
    public int deleteCostCustomerInfoByCostCustomerId(Long costCustomerId)
    {
        return costCustomerInfoMapper.deleteCostCustomerInfoByCostCustomerId(costCustomerId);
    }
}
